//axios.defaults.baseURL = 'http://wz85x7.natappfree.cc/maven_xiaomi/';
axios.defaults.headers.common['Authorization'] = 'token';
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
//检查用户名
function ajaxCheckUserName(username){
    return axios({
        url:'userservlet?method=checkUserName&username='+username,
        method:'get'
    })
}
//获取商品类别
function ajaxgoodstypelist(){
    return axios({
        url:'goodstypeservlet?method=goodstypelist',
        method:'get'
    })
}
//更新购物车
function ajaxupdatecart(pid,n){
    return axios({
        url:'cartservlet?method=addCartAjax&goodsId='+pid+'&number='+n,
        method:'get'
    })
}
//清空购物车
function ajaxclearcart(){
    return axios({
        url:'cartservlet?method=clearCartAjax',
        method:'get'
    })
}
//获取地址
function ajaxgetaddress(){
    return axios({
        url:'userservlet?method=getAddress',
        method:'get'
    })
}
//删除地址
function  ajaxdeleteaddress(id){
    return axios({
        url:'userservlet?method=deleteAddress&id='+id,
        method:'get'
    })
}
//更新地址
function  ajaxupdateaddress(id,name,phone,detail){
    return axios({
        url:'userservlet?method=updateAddress&id='+id+"&name="+name+"&phone="+phone+"&detail="+detail,
        method:'get'
    })
}

//默认地址
function ajaxdefaultAddr(id){
    return axios({
        url:'userservlet?method=defaultAddress&id='+id,
        method:'get'
    })
}